Method and apparatus for performing arbitration

ABSTRACT

An apparatus for performing arbitration increases the fairness of arbitrations, decreases system latency, increases system throughput, and is suitable for use in more complex systems. According to an exemplary embodiment, the apparatus includes a generator for generating a plurality of arbitration numbers corresponding to a plurality of agents, and circuitry for selecting one of the agents to access a resource shared by the agents based on the arbitration numbers. At least one of the arbitration numbers includes a plurality of fields corresponding to a plurality of parameters.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention generally relates to arbitration techniques fordigital systems, and more particularly, to a method and apparatus forperforming arbitration that increases the fairness of arbitrations,decreases system latency, increases system throughput, and is suitablefor use in more to complex systems.

2. Background Information

Arbitration is commonly used in digital systems to allocate systemresources, such as memory, buses and/or other resources, to more thanone is agent requesting access thereto. Conventional arbitration may bebased on a fixed or static priority scheme in which each agent has anassigned priority that is fixed at the time of manufacture and static(i.e., does not change). This type of arbitration, however, is less thanoptimal since it may essentially prevent certain low priority agentsfrom accessing a given resource. As a result, system latency mayincrease and system throughput may decrease. Other types of conventionalarbitration may not be suitable for handling more complex systems, suchas those systems having a relatively large number of agents that share aparticular resource.

Accordingly, there is a need for a method and apparatus for performingarbitration that addresses the foregoing problems, and thereby increasesthe fairness of arbitrations, decreases system latency, increases systemthroughput, and is suitable for use in more complex systems. The presentinvention addresses these and/or other issues.

SUMMARY OF THE INVENTION

In accordance with an aspect of the present invention, a method forperforming arbitration is disclosed. According to an exemplaryembodiment, the method comprises steps of generating a plurality ofarbitration numbers corresponding to a plurality of agents, selectingone of the agents to access a resource shared by the agents based on thearbitration numbers. At least one of the arbitration numbers includes aplurality of fields corresponding to a plurality of parameters.

In accordance with another aspect of the present invention, an apparatusfor performing arbitration is disclosed. According to an exemplaryembodiment, the apparatus comprises means for generating a plurality ofarbitration numbers corresponding to a plurality of agents, and meansfor selecting one of the agents to access a resource shared by theagents based on the arbitration numbers. At least one of the arbitrationnumbers includes a plurality of fields corresponding to a plurality ofparameters.

In accordance with another aspect of the present invention, an arbiteris disclosed. According to an exemplary embodiment, the arbitercomprises a generator operative to generate a plurality of arbitrationnumbers corresponding to a plurality of agents, and circuitry operativeto select one of the agents to access a resource shared by the agentsbased on the arbitration numbers. At least one of the arbitrationnumbers includes a plurality of fields corresponding to a plurality ofparameters.

BRIEF DESCRIPTION OF THE DRAWINGS

The above-mentioned and other features and advantages of this invention,and the manner of attaining them, will become more apparent and theinvention will be better understood by reference to the followingdescription of embodiments of the invention taken in conjunction withthe accompanying drawings, wherein:

FIG. 1 shows an environment suitable for performing arbitrationaccording to an exemplary embodiment of the present invention;

FIG. 2 shows the format of an arbitration number according to anexemplary embodiment of the present invention;

FIG. 3 shows an arbitration number generator according to an exemplaryembodiment of the present invention;

FIG. 4 shows a binary comparison tree for arbitration numbers accordingto an exemplary embodiment of the present invention;

FIG. 5 shows a flowchart for performing arbitration according to anexemplary embodiment of the present invention; and

FIG. 6 shows a flowchart for forming an arbitration number according toan exemplary embodiment of the present invention.

The exemplifications set out herein illustrate preferred embodiments ofthe invention, and such exemplifications are not to be construed aslimiting the scope of the invention in any manner.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

Referring now to the drawings, and more particularly to FIG. 1, anenvironment 100 suitable for performing arbitration according to anexemplary embodiment of the present invention is shown. Environment 100of FIG. 1 comprises arbiter 10 and a plurality of agents 20, 30, 40 and50 (i.e., 1, 2, 3 . . . N, where N is any integer). Arbiter 10 isoperatively coupled to agents 20, 30, 40 and 50 in the manner shown inFIG. 1 via any suitable signal transmission medium. As will be describedherein, arbiter 10 performs an arbitration function based on arbitrationnumbers to selectively allow agents 20, 30, 40 and 50 to access a sharedresource, such as a memory, bus or other resource. According to anexemplary embodiment, arbiter 10 and agents 20, 30, 40 and 50 may all beincluded on a single integrated circuit (IC), or may be included onmultiple ICs. Agents 20, 30, 40 and 50 may for example representdifferent digital system elements such as a central processing unit(CPU), a graphic engine, and/or other elements. According to anotherexemplary embodiment, arbiter 10 and agents 20, 30, 40 and 50 may eachbe embodied as and/or included within stand-alone user devices, such asaudio and/or video devices. Accordingly, the arbitration functiondescribed herein may be applicable to any type of system, device and/orapparatus that performs arbitration.

Referring now to FIG. 2, the format of an arbitration number 200according to an exemplary embodiment of the present invention is shown.

According to an exemplary embodiment, arbiter 10 generates and maintainsan arbitration number for each agent 20, 30, 40 and 50, and each ofthose arbitration numbers has the format of arbitration number 200 ofFIG. 2. For purposes of practicing the present invention, however, onlyone or more agent 20, 30, 40, 50 may have an arbitration number of theformat of arbitration number 200 of FIG. 2. Arbitration number 200 ofFIG. 2 comprises a plurality of concatenated fields including a Requestfield 210, a Timeout field 220, a Priority Value field 230, a PriorityMeter field 240, a Bandwidth Remaining field 250, a Wait Timer field 260and a Master Index field 270. Each of the foregoing fields represents adifferent parameter and includes a predetermined number of digital bits.According to an exemplary embodiment, Request field 210 is one bit,Timeout field 220 is one bit, Priority Value field 230 is four bits,Priority Meter field 240 is four bits, Bandwidth Remaining field 250 isten bits, Wait Timer field 260 is ten bits, and Master Index field 270is four bits. Other embodiments of the present invention may usedifferent numbers of bits for each of the foregoing fields. The fieldsare preferably arranged consecutively from the most significant bit(MSB) to the least significant bit (LSB) in the manner shown in FIG. 2and collectively form arbitration number 200. Other embodiments of thepresent invention may arrange the fields of arbitration number 200 in adifferent manner. Each field of arbitration number 200 is described asfollows:

Request Field 210

Request field 210 is used to request arbitration. Request field 210 hasan initial value of zero and changes dynamically to one when an agent20, 30, 40, 50 requests arbitration.

Timeout Field 220

Timeout field 220 is set to one when wait timer field 260 reaches apredetermined maximum time value. Timeout field 220 has an initial valueof zero and changes dynamically. Timeout field 220 for an agent 20, 30,40, 50 is cleared and set to zero when it wins arbitration.

Priority Value Field 230

Priority Value field 230 is set to a fixed, predetermined value for eachagent 20, 30, 40, 50 based on its nature. A higher value for PriorityValue field 230 indicates a higher priority level. Priority Value field230 is static by convention and may for example be set at the time ofmanufacture or be programmed at the time of system boot by a user.

Priority Meter Field 240

Priority Meter field 240 has an initial value of zero and changesdynamically. Priority Meter field 240 is incremented when an agent 20,30, 40, 50 loses arbitration. When Priority Meter field 240 reaches apredetermined maximum value, it remains at that value until that agent20, 30, 40, 50 wins arbitration. Priority Meter field 240 for an agent20, 30, 40, 50 is reinitialized to a predetermined value when it winsarbitration.

Bandwidth Remaining Field 250

Bandwidth Remaining field 250 is used to measure data words transferredby an agent 20, 30, 40, 50. Bandwidth Remaining field 250 has apredetermined initial value and changes dynamically. For an agent 20,30, 40, 50 that wins arbitration, Bandwidth Remaining field 250 isdecremented on a cycle basis while transferring data. BandwidthRemaining field 250 for an agent 20, 30, 40, 50 will stop at zero whenthe zero value is reached. The Bandwidth Remaining field 250 for eachagent is reinitialized when the Bandwidth Remaining fields of all theagents reach zero. An effect of this approach is that it lowers thepriority of those agents that already win the arbitration at least onceafter all the Bandwidth Remaining fields were last initialized.

Wait Timer Field 260

Wait Timer field 260 is used to measure how long an agent 20, 30, 40, 50has been waiting since its request was issued. Wait Timer field 260 hasa predetermined initial value and changes dynamically. An agent 20, 30,40, 50 having a lower latency requirement may for example be programmedwith a larger initial value than another agent 20, 30, 40, 50 withoutsuch a requirement. Wait Timer field 260 of a requesting agent 20, 30,40, 50 is incremented on a cycle basis until it wins arbitration. WaitTimer field 260 of an agent 20, 30, 40, 50 that wins arbitration isreset to its predetermined initial value. Wait timer field 260 fornon-requesting agents 20, 30, 40, 50 remains unchanged. Wait timer field260 for each agent 20, 30, 40, 50 will stop at a predetermined maximumvalue.

Master Index Field 270

Master Index field 270 is used as a tie-breaker. Each agent 20, 30, 40,50 has a unique value for its Master Index field 270. Master Index field270 is static and may for example be set at the time of manufacture.

The arbiter 10 in FIG. 1 may connected to a display and input mechanismssuch as buttons, so that a user may display the value of each field ofeach or all agents at any given instance. The user interface may alsoallow a user to enter the values of one or more of the following fields:the predetermined maximum value of the Timeout field 220, thepredetermined value of the Priority Value field 230, the predeterminedmaximum value of the Priority Meter field 240, the predetermined initialvalue of the Wait Timer field 260, and the value of the Master Indexfield 270.

Referring now to FIG. 3, an arbitration number generator 300 accordingto an exemplary embodiment of the present invention is shown.Arbitration number generator 300 is an element of arbiter 10. Asindicated in FIG. 3, arbitration number generator 300 is operative toreceive requests for arbitration (R0-R15) from agents 20, 30, 40, 50.Arbitration number generator 300 is also operative to generate and storearbitration numbers (A0-A15) for each agent 20, 30, 40, 50. According toan exemplary embodiment, each of those arbitration numbers (A0-A15) hasthe format shown in FIG. 2. For purposes of example and explanation,arbitration number generator 300 of FIG. 3 is shown as being capable ofreceiving sixteen requests for arbitration is (R0-R15) and generatingsixteen corresponding arbitration numbers (A0-A15). However, accordingto other embodiments, arbitration number generator 300 may be modifiedto receive a different number of requests for arbitration and generate acorresponding different number of arbitration numbers.

Referring now to FIG. 4, a binary comparison tree 400 for arbitrationnumbers according to an exemplary embodiment of the present invention isshown. Binary comparison tree 400 is also an element of arbiter 10.Binary comparison tree 400 of FIG. 4 comprises four stages representedby reference numbers 410, 420, 430 and 440. First stage 410 compriseseight comparators (COMP) that receive arbitration numbers (A0-A15) fromarbitration number generator 300 of FIG. 3 and perform a comparisonfunction to thereby select the eight highest arbitration numbers. Secondstage 420 comprises four comparators that receive the eight highestarbitration numbers from first stage 410 and perform a comparisonfunction to thereby select the four highest arbitration numbers. Thirdstage 430 comprises two comparators that receive the four highestarbitration numbers from second stage 420 and perform a comparisonfunction to thereby select the two highest arbitration numbers. Fourthstage 440 comprises one comparator that receives the two highestarbitration numbers from third stage 430 and performs a comparisonfunction to thereby select the highest arbitration number. Fourth stage440 also includes a flip-flop (FF) which receives and outputs thehighest arbitration number. In the aforementioned manner, binarycomparison tree 400 selects the highest arbitration number from amongthe sixteen arbitration numbers (A0-A15) provided from arbitrationnumber generator 300 of FIG. 3. The particular agent 20, 30, 40, 50having the highest arbitration number is then selected by arbiter 10 toaccess the resource. For purposes of example and explanation, binarycomparison tree 400 of FIG. 4 is constructed to accommodate sixteenarbitration numbers. However, binary comparison tree 400 may be modifiedaccordingly to accommodate a larger or smaller number of arbitrationnumbers. It is noted that the hardware implementation of binarycomparison tree 400 shown in FIG. 4 may also be implemented in software.Also, arbiter 10 may include elements such as a multiplexer and/or otherelements in addition to arbitration number generator 300 of FIG. 3 andbinary comparison tree 400 of FIG. 4. Such elements are not shown in theFIGS. so as not to obfuscate the inventive principles of the presentinvention.

Referring now to FIG. 5, a flowchart 500 illustrating steps forperforming arbitration according to an exemplary embodiment of thepresent invention is shown. For purposes of example and explanation, thesteps of FIG. 5 will be described with reference to elements of thepreviously described FIGS. The steps of FIG. 5 are exemplary only, andare not intended to limit the present invention in any manner.

At step 510, arbiter 10 determines whether there are one or morerequests for arbitration from agents 20, 30, 40, 50. According to anexemplary embodiment, an agent 20, 30, 50, 50 may request access to aresource (e.g., memory, bus, etc.) and thereby request arbitration bytransmitting a request signal to arbiter 10 at step 510. When an agent20, 30, 40, 50 requests arbitration at step 510, the Request field 210of its arbitration number 200 shifts from a zero to a one.

If the determination at step 510 is negative, process flow loops andstep 510 is repeated. Once the determination at step 510 is positive,process flow advances to step 520 where arbiter 10 enables its binarycomparison tree 400 (see FIG. 4) for an arbitration cycle. As previouslyindicated herein, arbiter 10 could also implement binary comparison tree400 in software.

At step 530, binary comparison tree 400 compares all arbitration numbers(A0-A15) in the manner previously described herein to thereby identifyand select the highest arbitration number. The particular agent 20, 30,40, 50 having the highest arbitration number is deemed to have won theis arbitration.

At step 540, arbiter 10 determines whether access to the requestedresource can be granted to the particular agent 20, 30, 40, 50 that wonthe arbitration. An agent 20, 30, 40, 50 that wins the arbitration isnormally granted access to the requested resource by arbiter 10.However, there are certain conditions under which a winning agent 20,30, 40, 50 may not be granted access to a requested resource. Forexample, in the case where the requested resource is a memory, a memorycontroller for that memory may be occupied performing other processingfunctions, and may therefore not be able to grant the winning agent 20,30, 40, 50 access to the memory resource. The memory, for example, maybe occupied by a previous arbitration winner. In the case that theprevious winner needs to access the memory for a long time, thearbitrator 10 allows the previous winner to access the memory until theBandwidth Remaining meter field of the previous winner reaches zero. Bythat time, if the previous winner still has data to read from or writeto the memory, the previous winner must win another arbitration in orderto complete the data transfer to or from the memory. As notedpreviously, when the Bandwidth Remaining fields of all the agents, allthe Bandwidth Remaining fields are initialized to a predetermined value.

If the determination at step 540 is negative, process flow advances tostep 550 where arbiter 10 increments Priority Meter field(s) 240 andWait Timer field(s) 260 of each agent(s) 20, 30, 40, 50 that requestedarbitration for that arbitration cycle at step 510. From step 550,process flow loops back to step 510 for another arbitration cycle.

If the determination at step 540 is positive, process flow advances tostep 560 where arbiter 10 grants the winning agent 20, 30, 40, 50 accessto the requested resource. Arbiter 10 also decrements BandwidthRemaining field 250 and resets Wait Timer field 260 to a predeterminedinitial value for the winning agent 20, 30, 40, 50 at step 560. Fromstep 560, process flow loops back to step 510 for another arbitrationcycle.

Referring now to FIG. 6, a flowchart 600 illustrating steps for formingan arbitration number for each agent according to an exemplaryembodiment of the present invention is shown. For purposes of exampleand explanation, the steps of FIG. 6 will be described with reference toelements of the previously described FIGS. The steps of FIG. 6 areexemplary only, and are not intended to limit the present invention inany manner.

At step 610, arbiter 10 receives a value for one of a plurality ofparameters. For example, arbiter 10 may receive a predetermined valuefor the Priority Value field 230 entered by a user. Other parameters,values of which may be entered by a user and received by arbiter 10, areas follows: the predetermined initial value of the Wait Timer field 260and the value of the Master Index field 270.

At step 620, arbiter 10 assigns the received value to the correspondingparameter. Continuing the above example, arbiter 10 assigns the receivedpredetermined value to the Priority Value field 230.

At step 630, arbiter 10 assigns a value to each of other parameters.Continuing the above example, arbiter 10 assigns values for Requestfield 210, Timeout field 220, Priority Meter field 240, BandwidthRemaining field 250, Wait Timer field 260, and Master Index field 270.

At step 640, arbiter 10 concatenates all the parameters into onearbitration number as shown in FIG. 2. As mentioned previously, sincemultiple arbitration parameters have been concatenated into a singlearbitration number for each agent, only one comparison tree, such as theone shown in FIG. 4 is required, increasing the speed of arbitration.

As described herein, the present invention provides a method andapparatus for performing arbitration that increases the fairness ofarbitrations, decreases system latency, increases system throughput, andis suitable for use in more complex systems. While this invention hasbeen described as having a preferred design, the present invention canbe further modified within the spirit and scope of this disclosure. Thisapplication is therefore intended to cover any variations, uses, oradaptations of the invention using its general principles. Further, thisapplication is intended to cover such departures from the presentdisclosure as come within known or customary practice in the art towhich this invention pertains and which fall within the limits of theappended claims.

1. A method for performing arbitration, comprising steps of: generatinga plurality of arbitration numbers corresponding to a plurality ofagents; selecting one of said agents to access a resource shared by saidagents based on said arbitration numbers; and wherein at least one ofsaid arbitration numbers includes a plurality of fields (210-270)corresponding to a plurality of parameters.
 2. The method of claim 1,wherein said agent having the highest said arbitration number isselected to access said resource.
 3. The method of claim 1, wherein afirst one of said fields indicates a static priority value for a firstone of said agents, a second one of said fields indicates a bandwidthvalue for said first agent, and a third one of said fields indicates anamount of time since said first agent requested access to said resource.4. The method of claim 3, wherein said plurality of fields arerepresented as a number of concatenated bits in which said first fieldoccupies a more significant bit position than said second field and saidsecond field occupies a more significant bit position than said thirdfield.
 5. The method of claim 3, wherein said second field isdecremented if said first agent is selected to access said resource. 6.The method of claim 3, wherein said third field is set to a predefinedvalue if said first agent is selected to access said resource.
 7. Themethod of claim 3, wherein said third field is incremented if said firstagent is not selected to access said resource.
 8. The method of claim 3,wherein said plurality of fields further includes a fourth field thatindicates a dynamic priority value for said first agent.
 9. The methodof claim 8, wherein said fourth field is incremented if said first agentis not selected to access said resource.
 10. The method of claim 8,wherein said plurality of fields further includes a fifth field that isset to a predefined value if said third field reaches a maximum value.11. An apparatus, comprising: means for generating a plurality ofarbitration numbers corresponding to a plurality of agents; means forselecting one of said agents to access a resource shared by said agentsbased on said arbitration numbers; and wherein at least one of saidarbitration numbers includes a plurality of fields corresponding to aplurality of parameters.
 12. The apparatus of claim 11, wherein saidagent having the highest said arbitration number is selected to accesssaid resource.
 13. The apparatus of claim 11, wherein a first one ofsaid fields indicates a static priority value for a first one of saidagents, a second one of said fields indicates a bandwidth value for saidfirst agent, and a third one of said fields indicates an amount of timesince said first agent requested access to said resource.
 14. Theapparatus of claim 13, wherein said plurality of fields are representedas a number of concatenated bits in which said first field occupies amore significant bit position than said second field and said secondfield occupies a more significant bit position than said third field.15. The apparatus of claim 13, wherein said second field is decrementedif said first agent is selected to access said resource.
 16. Theapparatus of claim 13, wherein said third field is set to a predefinedvalue if said first agent is selected to access said resource.
 17. Theapparatus of claim 13, wherein said third field is incremented if saidfirst agent is not selected to access said resource.
 18. The apparatusof claim 13, wherein said plurality of fields (210-270) further includesa fourth field that indicates a dynamic priority value for said firstagent.
 19. The apparatus of claim 18, wherein said fourth field isincremented if said first agent is not selected to access said resource.20. The apparatus of claim 18, wherein said plurality of fields(210-270) further includes a fifth field that is set to a predefinedvalue if said third field reaches a maximum value.
 21. An arbiter,comprising: a generator operative to generate a plurality of arbitrationnumbers corresponding to a plurality of agents; circuitry operative toselect one of said agents to access a resource shared by said agentsbased on said arbitration numbers; and wherein at least one of saidarbitration numbers includes a plurality of fields corresponding to aplurality of parameters.
 22. The arbiter of claim 21, wherein said agenthaving the highest said arbitration number is selected to access saidresource.
 23. The arbiter of claim 21, wherein a first one of saidfields indicates a static priority value for a first one of said agents,a second one of said fields indicates a bandwidth value for said firstagent, and a third one of said fields indicates an amount of time sincesaid first agent requested access to said resource.
 24. The arbiter ofclaim 23, wherein said plurality of fields are represented as a numberof concatenated bits in which said first field occupies a moresignificant bit position than said second field and said second fieldoccupies a more significant bit position than said third field.
 25. Thearbiter of claim 23, wherein said second field is decremented if saidfirst agent is selected to access said resource.
 26. The arbiter ofclaim 23, wherein said third field is set to a predefined value if saidfirst agent is selected to access said resource.
 27. The arbiter ofclaim 23, wherein said third field is incremented if said first agent isnot selected to access said resource.
 28. The arbiter of claim 23,wherein said plurality of fields further includes a fourth field thatindicates a dynamic priority value for said first agent.
 29. The arbiterof claim 28, wherein said fourth field is incremented if said firstagent is not selected to access said resource.
 30. The arbiter of claim28, wherein said plurality of fields further includes a fifth field thatis set to a predefined value if said third field reaches a maximumvalue.
 31. A method for assigning an arbitration number for at least oneof a plurality of agents, one of said agents being selected to access aresource shared by said agents according to said arbitration numberassigned to said at least one of said agents, said method comprisingsteps of: receiving a first value for one of a plurality of arbitrationparameters; assigning a value to each of other arbitration parameters;and concatenating said plurality of arbitration parameters to form saidarbitration number.